package com.niit.onlinemusicserver34.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler
    public R handleRuntimeException(RuntimeException e){
        return R.error(e.getMessage());
    }


//    @ExceptionHandler
//    public R handleException(Exception e){
//        return R.error(e.getMessage());
//    }
}
